package 蓝桥真题;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class 排序 {
       static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
       final static int N=36; 
       static char[]chs=new char[N];
       static boolean[]st=new boolean[N];
       
       static boolean is100(char[]chs,int d){
    	       int k=0;
    	       for(int i=0;i<d-1;i++)
    	    	   for(int j=0;j<d-1-i;j++){
    	    		   if(chs[j]>chs[j+1]){
    	    			   char t=chs[j];
    	    			   chs[j]=chs[j+1];
    	    			   chs[j+1]=t;
    	    			   k++;
    	    		   }
    	    	   }
    	      return k==100; 
       }
       static void dfs(int d){
    	      if(d>0){
    	    	 
    	    	  if(is100( Arrays.copyOf(chs, d),d)){
    	    		  System.out.print(chs);
    	    		  return;
    	    	  }
    	    	  if(d==26)return;
    	      }
    	      for(char i='a';i<='z';i++){
    	    	  int u=i-'a';
    	    	  if(!st[u]){
    	    		 chs[d]=i;
        	    	 st[u]=true; 
        	    	 dfs(d+1);
        	    	 st[u]=false;
    	    	  }
    	      }
       }
       public static void main(String[]args)throws Exception{
    	      dfs(0);
       }
}
